package com.haiheng.library_base.model

import android.app.Application
import androidx.lifecycle.AndroidViewModel
import com.haiheng.library_base.msg.MsgEvent
import com.haiheng.library_base.utils.ApplicationUtils

/**
 *
 * @Des:
 * @Author: hwz
 * @Date:2021/9/2 0002
 * @Version: 1.0
 */
class ApplicationViewModel constructor(application: Application) :AndroidViewModel(application) {

    var even: UnFlowLiveData<MsgEvent> = UnFlowLiveData()

    companion object{
        private var instance: ApplicationViewModel?= null
        get() {
            if (field == null){
                field = ApplicationViewModel(ApplicationUtils.application)
            }
            return field
        }

        @Synchronized
        fun get(): ApplicationViewModel {
            return instance!!
        }
    }
}